package com.monitor.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.monitor.dao.ErpScrapTireMapper;
import com.monitor.entity.ErpScrapTire;
import com.monitor.service.ErpScrapTireService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 物料报废表 服务实现类
 * </p>
 *
 * @author LX
 * @since 2018-09-12
 */
@Service
public class ErpScrapTireServiceImpl extends ServiceImpl<ErpScrapTireMapper, ErpScrapTire> implements ErpScrapTireService {

    @Resource
    private ErpScrapTireMapper mapper;

    @Override
    public ErpScrapTire listToObject(List<Object> list) {
        ErpScrapTire tire=new ErpScrapTire();
        tire.setScrDt((list.get(1).toString()));
        tire.setScrSource(list.get(2)==null?"":list.get(2).toString());
        tire.setScrName(list.get(3)==null?"":list.get(3).toString());
        tire.setScrSpecifications(list.get(4)==null?"":list.get(4).toString());
        tire.setScrModel(list.get(5)==null?"":list.get(5).toString());
        tire.setScrProduceid(list.get(6)==null?"":list.get(6).toString());
        tire.setScrPalydate(list.get(7)==null?"":list.get(7).toString());
        tire.setScrPrice(list.get(8)==null?"":list.get(8).toString());
        tire.setScrPricerepair(list.get(9)==null?"":list.get(9).toString());
        tire.setScrPperatingmileage(list.get(10)==null?"":list.get(10).toString());
        tire.setScrEstimatedmileage(list.get(11)==null?"":list.get(11).toString());
        tire.setScrYqgl(list.get(12)==null?"":list.get(12).toString());
        tire.setScrState(list.get(13)==null?"":list.get(13).toString());
        Double d=0.00;
        d=list.get(14)==null?d:Double.parseDouble(list.get(14).toString());
        tire.setScrTread1(d);
        Double f=0.00;
        f=list.get(15)==null?f:Double.parseDouble(list.get(15).toString());
        tire.setScrTread2(f);
        Double i=0.00;
        i=list.get(16)==null?i:Double.parseDouble(list.get(16).toString());
        tire.setScrTread3(i);
        Double p=0.00;
        p=list.get(17)==null?p:Double.parseDouble(list.get(17).toString());
        tire.setScrTread4(p);
        tire.setScrInput(list.get(18)==null?"":list.get(18).toString());
        return tire;
    }
}
